//    Copyright (C) Kherty.  All rights reserved.
using System.Diagnostics.Contracts;
using System.Reflection;
using OpenLS.Core.Notification;
using OpenLS.Core.Serialization;
using OpenLS.Drawing;
using System.ComponentModel;

namespace OpenLS.Chart
{
    public class ChartLines : ViewModelBase, IOfficeXmlSerializableAs, IShape
    {
        private ShapeProperties spPr;

        public ShapeProperties ShapeProperties
        {
            get
            {
                return spPr;
            }
            set { spPr = value;
                notifyPropertyChanged("ShapeProperties"); }
        }

        #region IOfficeXmlSerializableAs Members

        void IOfficeXmlSerializableAs.ReadXmlAs(string name, ReadContext context)
        {
            using (var c = context.Read(name))
            {
                ShapeProperties = c.ReadOptionalElement<ShapeProperties>("spPr");
            }
        }

        void IOfficeXmlSerializableAs.WriteXmlAs(string name, WriteContext context)
        {
            using (WriteContext c = context.Write(name))
            {
                c.WriteOptionalElement(ShapeProperties);
            }
        }

        #endregion

    }
}